﻿using System;
using System.Collections.Generic;
using System.Text;
using HZ.Supervise.Model;
using System.Data;

namespace HZ.Supervise.DAL
{
    public class DAL_Purchase
    {
        /// <summary>
        /// 获取医院处方单
        /// </summary>
        /// <param name="prescriptionDetail"></param>
        /// <param name="currentpage"></param>
        /// <param name="pagesize"></param>
        /// <param name="totalrecord"></param>
        /// <returns></returns>
        public static DataTable GetProcureCatalogByID(string where, int currentpage, int pagesize, out int totalrecord)
        {
            string sql = string.Format("select * from View_HosTotalCount where 1=1 {0}", where);
            HZ.Data.PageDescribe des = new HZ.Data.PageDescribe(sql, pagesize);
            des.CurrentPage = currentpage;
            totalrecord = des.TotalCount;
            return des.GetSpecailPage();
        }
        /// <summary>
        /// 根据流水号查看医院信息
        /// </summary>
        /// <param name="ProcureCatalogID"></param>
        /// <param name="currentpage"></param>
        /// <param name="pagesize"></param>
        /// <param name="totalrecord"></param>
        /// <returns></returns>
        public static DataTable GetHospitalInfoByProcureCatalogID(string where, int currentpage, int pagesize, out int totalrecord) 
        {
            string sql = string.Format("select * from View_HosTotalDetailCount where 1=1 {0}", where);
            HZ.Data.PageDescribe des = new HZ.Data.PageDescribe(sql, pagesize);
            des.CurrentPage = currentpage;
            totalrecord = des.TotalCount;
            return des.GetSpecailPage();
        }
        /// <summary>
        /// 查看医生列表
        /// </summary>
        /// <param name="prescripion"></param>
        /// <param name="currentpage"></param>
        /// <param name="pagesize"></param>
        /// <param name="totalrecord"></param>
        /// <returns></returns>
        public static DataTable GetPdoctorNameByPHospitalId(string where, int currentpage, int pagesize, out int totalrecord) 
        {
            string sql = string.Format("select * from View_DoctorTotalDetailCount where 1=1 {0}", where);
            HZ.Data.PageDescribe des = new HZ.Data.PageDescribe(sql, pagesize);
            des.CurrentPage = currentpage;
            totalrecord = des.TotalCount;
            return des.GetSpecailPage();
        }
        /// <summary>
        /// 查看处方单列表
        /// </summary>
        /// <param name="prescripion"></param>
        /// <param name="currentpage"></param>
        /// <param name="pagesize"></param>
        /// <param name="totalrecord"></param>
        /// <returns></returns>
        public static DataTable GetPrescriptionNameByPdoctorName(string where, int currentpage, int pagesize, out int totalrecord)
        {
            string sql = string.Format("select * from View_Prescription where 1=1 {0}", where);
            HZ.Data.PageDescribe des = new HZ.Data.PageDescribe(sql, pagesize);
            des.CurrentPage = currentpage;
            totalrecord = des.TotalCount;
            return des.GetSpecailPage();
        }

    }
}
